﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ThreadForm
{
    internal class CTextOutput
    {
        public volatile bool shouldstop=false;
        public volatile string strOutputText;

        private Form1 Form1;

        public CTextOutput(Form1 form1, string strtext) { 
             this.Form1 = form1;
            strOutputText = strtext;
        }

        public void WriteText() {
            Form1.AddText(strOutputText);
            while (shouldstop == false) {
                Thread.Sleep(1000);
                Form1.AddText(strOutputText);
            }
            Form1.AddText("自动填表线程终止");
        }
    }
}
